
/*
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/*
 * lmgbary.c
 * lmg.c
 * lmgcycles.c
 * lmgdfs.c
 * lmg.h
 * lmginout.c
 * lmglevel.c
 * lmgmem.c
 * lmgne.c
 * lmgself.c
 * lmgsplit.c
 * lmguniqn.c
 * lmgvar.c
 */

#ifndef LIBMOOIGRAPH_H
#define LIBMOOIGRAPH_H 1

struct lmgnode
{
  char *name;
  struct lmgedgel *poe;
  struct lmgedgel *poeend;
  struct lmgedgel *in;
  struct lmgedgel *inend;
  struct lmgedgel *out;
  struct lmgedgel *outend;
  char *label;			/* edgelabel */
  int textcolor;		/* edgelabel */
  int fontsize;			/* edgelabel */
  char *fontname;		/* edgelabel */
  struct
  {
    int level;
    int position;
  } tree_layout;
  struct
  {
    unsigned int done:1;
    unsigned int hasin:1;	/* set if node has incoming edges */
    unsigned int hasout:1;	/* set if node has outgoing edges */
    unsigned int edgelabel:1;	/* set if node is an edgelabel */
    unsigned int textbold:1;	/* set if label has bold text font */
    unsigned int textitalic:1;	/* set if label has italic text font */
    unsigned int textoblique:1;	/* set if label has oblique text font */
  } bitflags;
};

struct lmgnodel
{
  struct lmgnode *node;
  struct lmgnodel *next;
};

struct lmgedge
{
  struct lmgnode *from;
  struct lmgnode *to;
  int color;
  int style;
  struct
  {
    unsigned int reversed:1;	/* if set edge is direction reversed */
  } bitflags;
};

struct lmgedgel
{
  struct lmgedge *edge;
  struct lmgedgel *next;
};

extern char *lmg_version (void);
extern void lmg_debug (int on_off);
extern void lmg_init (void);
extern void lmg_deinit (void);
extern void lmg_addnode (char *name);
extern void lmg_addedge (char *from, char *to, char *label, int color,
			 int style, int textcolor, int fontsize,
			 char *fontname, int bold, int italic, int oblique);
extern void lmg_main (void);
extern int lmg_nlevels (void);
extern int lmg_nal (int level);
extern int lmg_nnodes (void);
extern int lmg_ndummynodes (void);
extern int lmg_nedges (void);
extern int lmg_nrevedges (void);
extern int lmg_ncrossings (void);
extern struct lmgnodel *lmg_nodehead (int level);
extern struct lmgedgel *lmg_edgehead (void);
extern int lmg_nrealnodes (void);
extern int lmg_nrealedges (void);

#endif

/* End */
